<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>stapes例子17</title>
    <script type="text/javascript" src="../lib/stapes-0.8.1/stapes.js"></script>
    <script type="text/javascript" src="../lib/jquery-easyui-1.4.2/jquery.min.js"></script>
</head>
<body>
<h1>你好!!!</h1>

<div id="app">11111</div>


<script type="text/javascript">
    var Module = Stapes.subclass();
    var singers = ['Johnny', 'Emmylou', 'Gram', 'June'];
    var module = new Module();

    module.msg = "I'll be your ";

    module.push(singers);

    module.each(function(singer) {
        console.log(this.msg + singer);
    });

    // Using the second context parameter of each()
    module.singers = new (Stapes.subclass());
    module.singers.push( singers );

    module.singers.each(function(singer) {
        console.log(this.msg + singer);
    }, module);

    module.push([
        {
            name : 'Johnny',
            playing : true
        },
        {
            name : 'Emmylou',
            playing : true
        }
    ]);

    console.log( "---------" );

    var playing = module.filter(function(singer) {
        return singer.playing;
    }); // [ { name : 'Emmylou', playing : true }]

    console.log( playing );


</script>


</body>
</html>